import { RESPONSE_CODE, RESPONSE_MESSAGE } from 'src/common/enum';

/**
 * @description 封装一个公共的数据响应体
 * @param data 详情数据
 * @param msg 响应消息
 * @param code 响应状态码
 * @returns 返回封装过的响应数据
 */
export const responseMessage = (
  data,
  msg: string = RESPONSE_MESSAGE.SUCCESS,
  code: number = RESPONSE_CODE.SUCCESS,
) => {
  return {
    data,
    msg,
    code,
  };
};
